from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.serializers.GoodsChannel_serializers import *
from meiduo_admin.paginations import MyPage

class GoodsChannelView(ModelViewSet):
    queryset = GoodsChannel.objects.all()
    serializer_class =GoodsChannelSerializer
    pagination_class = MyPage


class GoodsChannelGroupView(ListAPIView):
    queryset = GoodsChannelGroup.objects.all()
    serializer_class = GoodsChannelGroupSerializer


class GoodsChannelCategoriesView(ListAPIView):
    queryset = GoodsCategory.objects.filter(parent=None)
    serializer_class = GoodsChannelCategoriesSerializer